<nz-spin *ngIf="isLoading" class="modal-spin"></nz-spin>
<h2><i class="anticon anticon-exception"></i> 票据详情</h2>
<div *ngIf="!isLoading">
  <desc-list [col]="2">
    <desc-list-item term="提交用户">{{ entity.cusName }}({{entity.currShopRole|dicsNamePipe:otcShopCusRole}})
    </desc-list-item>
    <desc-list-item term="所属店铺">{{entity.shopTitle}}</desc-list-item>
    <desc-list-item term="获得积分">{{entity.credit}}</desc-list-item>
    <desc-list-item term="状态">{{entity.status|dicsNamePipe:statusOption}}</desc-list-item>
    <desc-list-item term="提交时间">{{entity.saveDate}}</desc-list-item>
    <desc-list-item term="审核人">{{entity.auditingName}}</desc-list-item>
    <desc-list-item term="审核时间">{{entity.auditingTime}}</desc-list-item>
    <desc-list-item term="审核说明">{{entity.auditingReason}}</desc-list-item>
  </desc-list>
  <p style="margin-top: 16px;">票据图：<br/>
    <ng-container *ngFor="let img of imgs">
      <img [src]="img+'?imageView2/2/w/120/h/120/q/85'|qCloudDomain" (click)="showPic(img)" title="点击查看大图"
           style="max-height: 120px;max-width: 120px;margin:5px;cursor: pointer;" alt="加载出错"/>
    </ng-container>
  </p>
  <ng-container *ngIf="entity.status == 2">
    <h2><i class="anticon anticon-exception"></i> 积分详情</h2>
    <nz-table #basicTable [nzData]="entity.otcCreditRecordList" [nzShowPagination]="false">
      <thead>
      <tr>
        <th style="max-width: 460px;">类型</th>
        <th>获得角色</th>
        <th>积分/盒</th>
        <th>数量</th>
        <th>积分</th>
      </tr>
      </thead>
      <tbody>
      <ng-container *ngFor="let record of basicTable.data">
        <ng-container *ngFor="let data of record.otcCreditBillList">
        <tr>
          <td style="max-width: 460px;">{{data.goodsId==1?"大盒":(data.goodsId==2?"小盒":"袋装")}}</td>
          <td>{{record.currShopRole|dicsNamePipe:otcShopCusRole}}</td>
          <td>{{data.singleCredit}}</td>
          <td>{{data.quantity}}</td>
          <td>{{data.totalCredit}}</td>
        </tr>
        </ng-container>
      </ng-container>
      </tbody>
    </nz-table>
  </ng-container>
</div>
<div class="modal-footer">
  <button nz-button type="button" (click)="close()">关闭</button>
</div>
<pic-viewer [picList]="picList" [picIdx]="0" [show]="isShowPic" (onClose)="onPicClose($event)"></pic-viewer>
